<template>
  <div>
    <a-dropdown>
      <a class="ant-dropdown-link" @click="e => e.preventDefault()">
        Hover me <a-icon type="down" />
      </a>
      <a-menu slot="overlay">
        <a-menu-item>
          <a href="javascript:;"><a-icon type="lock" /> 修改密码</a>
        </a-menu-item>
        <a-menu-item>
          <a  @click="loginOut"> <a-icon type="logout" />  退出登录</a>
        </a-menu-item>
      </a-menu>
    </a-dropdown>
  </div>

</template>

<script>
export default {
  methods: {
    loginOut () {
      // 清除 token，返回登录页
      window.sessionStorage.clear('token')
      this.$router.push('/login')
    }
  }
}
</script>
